import * as YvanUI from "yvan-ui-wotu";

const _ = YvanUI.lodash

const React = YvanUI.React

interface Ref {

}

export default class DemoPromiseVJson extends YvanUI.Scope<void, Ref> {

    vjson = () => new Promise((resolve, reject) => {
        setTimeout(() => {

            const items: any[] = []
            for (let i = 0; i < 100; i++) {
                items.push({
                    view: 'text',
                    label: '输入框' + i,
                    required: i % 3
                })
            }

            resolve({
                title: '这是动态界面',
                items: [
                    {
                        view: 'form',
                        items: [
                            {
                                view: 'card',
                                rows: [
                                    {
                                        cols: items
                                    }
                                ]
                            }
                        ]
                    }
                ]
            })

        }, 0)
    })
}